package com.hxkj.dao.impl;

import com.hxkj.dao.DepartmentDao;
import com.hxkj.mapper.DepartmentMapper;
import com.hxkj.domain.po.Department;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-05-21 17:59:26
*
*/
@Service("departmentDao")
public class DepartmentDaoImpl implements DepartmentDao {

    @Resource
    private DepartmentMapper departmentMapper;

    @Override
    public Department get(Long departmentId) {
        return departmentMapper.selectByPrimaryKey(departmentId);
    }

    @Override
    public List<Department> get(Department department) {
        return departmentMapper.select(department);
    }

    @Override
    public int delete(Long departmentId) {
        return departmentMapper.deleteByPrimaryKey(departmentId);
    }

    @Override
    public int delete(Department department) {
        return departmentMapper.delete(department);
    }

    @Override
    public int save(Department department) {
        return departmentMapper.insert(department);
    }

    @Override
    public int update(Department department) {
        return departmentMapper.update(department);
    }
}
